package util;

import java.sql.Connection;
import java.sql.DriverManager;

/**
 * Connection to underlying database
 * 
 * @author Xiaohui
 * 
 */
public class DBConn implements Constants {
	static Connection con = null;

	public static Connection getConn() {
		if (con == null) {
			try {
				// Register the JDBC driver for MySQL.
				Class.forName("com.mysql.jdbc.Driver");
				con = DriverManager
						.getConnection(trajDBURL, username, password);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return con;
	}
}
